home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #3 / Amiga Plus CD - 1996 - No. 3.iso / demo-versionen / amigaoberland / finalwriter_v4.0 / fwfiles / init.ps < prev    next >
Text File  |  1995-07-13  |  6KB  |  206 lines

  1. %! Initialization file for postscript interpreter
  2. %  $Id: init.ps,v 1.1 1994/12/23 13:47:46 Woody Exp $
  3. %  $Date: 1994/12/23 13:47:46 $
  4. %  $Revision: 1.1 $
  5. %  $Revision Date: 92/12/19$
  6. %
  7. %    Used By Final Writer to aid in interpreting EPS Files
  8. %
  9.  
  10. % PostScript software version
  11. /version (48.0) def
  12.  
  13. % Ignore CTRL/D
  14.  
  15. <04> cvn {} def
  16.  
  17. % A dummy status dictionary
  18.  
  19. /statusdict 10 dict dup begin
  20. /waittimeout 0 def
  21. /checkpassword { 0 eq } bind def
  22. /product (Post V1.7) def
  23. end def
  24.  
  25. % A dummy server dictionary
  26.  
  27. /serverdict 5 dict dup begin
  28. /exitserver { pop } bind def
  29. end def
  30.  
  31. % The internal dictionary
  32.  
  33. %/internaldict { pop null } dup 1 5 dict put def
  34. %1183615869 internaldict begin
  35. %/StemSnapLength 12 def
  36. %end
  37.  
  38. % A scratch string
  39.  
  40. /=string 256 string def
  41.  
  42. % ISO Latin 1 encoding vector (omitting accents 90 - 9f)
  43.  
  44. systemdict
  45. /ISOLatin1Encoding [
  46. StandardEncoding 0 160 getinterval
  47. /space/exclamdown/cent/sterling
  48. /currency/yen/brokenbar/section
  49. /dieresis/copyright/ordfeminine/guillemotleft
  50. /logicalnot/hyphen/registered/macron
  51. /degree/plusminus/twosuperior/threesuperior
  52. /acute/mu/paragraph/periodcentered
  53. /cedilla/onesuperior/ordmasculine/guillemotright
  54. /onequarter/onehalf/threequarters/questiondown
  55. /Agrave/Aacute/Acircumflex/Atilde
  56. /Adieresis/Aring/AE/Ccedilla
  57. /Egrave/Eacute/Ecircumflex/Edieresis
  58. /Igrave/Iacute/Icircumflex/Idieresis
  59. /Eth/Ntilde/Ograve/Oacute
  60. /Ocircumflex/Otilde/Odieresis/multiply
  61. /Oslash/Ugrave/Uacute/Ucircumflex
  62. /Udieresis/Yacute/Thorn/germandbls
  63. /agrave/aacute/acircumflex/atilde
  64. /adieresis/aring/ae/ccedilla
  65. /egrave/eacute/ecircumflex/edieresis
  66. /igrave/iacute/icircumflex/idieresis
  67. /eth/ntilde/ograve/oacute
  68. /ocircumflex/otilde/odieresis/divide
  69. /oslash/ugrave/uacute/ucircumflex
  70. /udieresis/yacute/thorn/ydieresis
  71. ] put
  72.  
  73. % Run a program with save and restore
  74.  
  75. /runsave
  76. { /saveobject save def
  77.   run
  78.   saveobject restore
  79. } bind def
  80.  
  81. % Run a program displaying its name
  82.  
  83. /runprog
  84. { dup print (\n) print
  85.   runsave
  86. } bind def
  87.  
  88. % New cache parameters ops
  89.  
  90. systemdict
  91. /setcacheparams
  92. { counttomark 1 ge { dup setcachelimit } if
  93.   cleartomark
  94. } bind put
  95.  
  96. systemdict
  97. /currentcacheparams
  98. { mark cachestatus 6 { exch pop} repeat dup
  99. } bind put
  100.  
  101. % Load a font file.  Build the file name string from the font name, prefix
  102. % and suffix strings.  We pop the dictionary stack first, so that the
  103. % contents of any additional entries on it can't interfere with the font
  104. % definition - e.g. if it uses the bind operator.  Then we try to open the
  105. % file.  If it opens OK we execute it; if the open fails we return without
  106. % error: presumabaly we don't have the font.  Before returning we restore the
  107. % dictionary stack.
  108.  
  109. systemdict
  110. /loadfont
  111. { 1 index =string copy                         % Prefix:
  112.   length                                       % length
  113.   3 index =string 2 index 100 getinterval cvs  % Prefix:name
  114.   length add                                   % length
  115.   1 index =string 2 index 100 getinterval copy % Prefix:name.suffix
  116.   length add                                   % length
  117.   =string exch 0 exch getinterval              % Truncate to length
  118.   mark countdictstack 2 sub
  119.       { currentdict end } repeat               % Pop dict stack
  120.   counttomark 1 add index                      % Get the file name
  121.   { fontfile } stopped                         % Try to open the file
  122.   { pop }                                      % Can't open it, ignore
  123.   { cvx exec }                                 % Opened OK, execute it
  124.   ifelse
  125.   counttomark { begin } repeat pop             % Restore dictionary stack
  126.   pop pop pop pop                              % Pop file name and arguments
  127. } bind put
  128.  
  129. % Find a font.  If it is not there we try in order:
  130. %
  131. %    Load       PSFonts:name
  132. %    Load       PSFonts:OtherFonts/name
  133. %    Substitute DefaultFont
  134. %
  135. % If none of these succeeds, the result will an invalidfont error.
  136.  
  137. systemdict /.findfont systemdict /findfont get put
  138.  
  139. systemdict
  140. /findfont
  141. {
  142. % Comment out the next 3 lines if you don't have a PSFonts: directory
  143. % If you have a directory containing Type-1 fonts to use for EPS clip
  144. % art, substitute the path name of the directory for "PSFonts:" below.
  145. % dup FontDirectory exch known not             % Not in FontDirectory?
  146. % { dup (PSFonts:) () loadfont                 % Try to load from PSFonts:
  147. % } if
  148.  
  149. % If you want to search more than one directory, duplicate the following
  150. % few lines for each additional font directory path.
  151. % dup FontDirectory exch known not             % Not in FontDirectory?
  152. % { dup (PSFonts:OtherFonts/) () loadfont      % Try PSFonts:OtherFonts
  153. % } if
  154.  
  155. % Substitute DefaultFont
  156.   dup FontDirectory exch known not             % Not in FontDirectory?
  157.   { dup userdict /DefaultFontName get ne       % Not the DefaultFont
  158.     { pop userdict /DefaultFontName get        % Substitue DefaultFont
  159.       dup systemdict /findfont get exec pop    % Recurse so it gets loaded
  160.     }
  161.     if
  162.   }
  163.   if
  164.   dup FontDirectory exch known not             % Not in FontDirectory?
  165.   { pop /DummyFont } if                        % Fall back on DummyFont
  166.   .findfont                                    % If errors, will fail now
  167. } bind put
  168.  
  169. % Select a font
  170.  
  171. systemdict
  172. /selectfont
  173. { exch findfont exch
  174.   dup type /arraytype eq
  175.   { makefont }
  176.   { scalefont }
  177.   ifelse
  178.   setfont
  179. } bind put
  180.  
  181. % Define a dummy font - prints out big dots ...
  182.  
  183. /DummyFont 10 dict dup begin
  184. /FontName /DummyFont def
  185. /FontMatrix [0.001 0 0 0.001 0 0] def
  186. /FontType 3 def
  187. /FontBBox [0 -300 500 700] def
  188. /Encoding StandardEncoding def
  189. /BuildChar
  190. { pop pop
  191.   500 0 50 0 450 400 setcachedevice
  192. % 250 200 200 0 360 arc fill
  193. } bind def
  194. /Painttype 0 def
  195. end definefont pop
  196.  
  197. % Establish the dummy font as the default, as some fonts need it to
  198. % define themselves.
  199. /DefaultFontName /DummyFont def
  200.  
  201. % Put a null function in place of showpage for those naughty
  202. % people who put showpages in their EPS files (tsk, tsk...)
  203. % without this the objects will come up blank on the screen
  204. % because their "showpage" clears the bitmap.
  205. systemdict /showpage {} put
  206.